package org.tuling.tlmallusersentineldemo.feign;

import feign.Param;
import feign.RequestLine;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import org.tuling.tlmallcommon.Result;
import org.tuling.tlmallusersentineldemo.exception.FallbackOrderFeignService;
import org.tuling.tlmallusersentineldemo.feign.dto.OrderDTO;


@FeignClient(value = "tlmall-order-sentinel-demo",path = "/order",fallback = FallbackOrderFeignService.class)
public interface OrderFeignService {


    /**
     * 根据用户id查询订单信息
     * @param userId
     * @return
     */
    @GetMapping("/getOrder")
    Result<?> getOrder(@RequestParam("userId") String userId);


    @GetMapping(value = "/post1")
    Result<?>  post1(@RequestBody OrderDTO orderDTO);


    @PostMapping("/post2")
    Result<?>  post2(@RequestBody OrderDTO orderDTO,@RequestParam("token") String token);


    @PostMapping(value = "/post3/{userId}")
    Result<?> post3(@RequestBody OrderDTO orderDTO, @PathVariable("userId") String userId);



}